<html>
<head>
<title> Index </title>
<link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">

</head>
<body>
{% if admin %}
	<h1> Administrador: {{usuario}} </h1>
	<h2> Professores: </h2>
	{% if professor_list %}
	    <ul>
	    {% for professor in professor_list %}
	        <li>{{ professor.nome }} 
	        	<a href="http://127.0.0.1:8000/elearning/{{professor.id}}/"> details </a>
	        	</li>
	    {% endfor %}
	    </ul>
	{% else %}
    	<p>Nenhum professor cadastrado.</p>
	{% endif %}
	<h2> Alunos: </h2>
	{% if alunos_list %}
	    <ul>
	    {% for aluno in alunos_list %}
	        <li>{{ aluno.nome }} 
	        	<a href="http://127.0.0.1:8000/elearning/aluno-detalhes/{{aluno.id}}/"> details </a>
	        </li>
	    {% endfor %}
	    </ul>
	{% else %}
    	<p>Nenhum professor cadastrado.</p>
	{% endif %}
	<a href="http://127.0.0.1:8000/elearning/buscarCEP/"> Cadastrar novo Professor</a> <br />
	<a href="http://127.0.0.1:8000/elearning/buscarCEPaluno/"> Cadastrar novo Aluno</a>
{% elif professor %}
	<h1> Professor: {{usuario}} </h1>
	{% if disciplina_list %}
		Disciplinas em que leciona: <br />
		<ul>
	    {% for disciplina in disciplina_list %}
	    	======================================
	        <li>Nome:     {{ disciplina.nome }}</li>
	        <li>Conteudo: {{ disciplina.conteudo}}</li>
	        <a href="http://127.0.0.1:8000/elearning/listarAlunosDaDisciplina/{{disciplina.id}}/">Ver </a> <br />
	        ======================================
	        </br>        
	    {% endfor %}
	    </ul>  
	{%else %} 
		<p>Nenhuma disciplina cadastrada.</p>
	{% endif %}
	<a href="http://127.0.0.1:8000/elearning/listarProfessores/"> Lista de Professores </a>
{% elif aluno %}
	<h1> Aluno: {{usuario}} </h1>
	{% if disciplina_list %}
		Disciplinas que cursa: <br />
		<ul>
	    {% for disciplina in disciplina_list %}
	    	======================================
	        <li>Nome:     {{ disciplina.nome }}</li>
	        <li>Conteudo: {{ disciplina.conteudo}}</li>
	        <a href="http://127.0.0.1:8000/elearning/listarAlunosDaDisciplina/{{disciplina.id}}/">Ver </a> <br />
	        ======================================
	        </br>        
	    {% endfor %}
	    </ul>  
	{%else %} 
		<p>Cadastrado em nenhuma disciplina.</p>
	{% endif %}
	<a href="http://127.0.0.1:8000/elearning/listarDisciplinas/"> Lista disciplinas </a>
{% endif %}
</br></br>
<a href="http://127.0.0.1:8000/accounts/logout/"> Logout</a>
</body>
</html>